<form method="POST" action="index.php?app=b2c&ctl=admin_business_basicmsg&act=add" class="tableform" id="newmember-edit-form">
<div class="division">
<{input type="hidden" name="is_main" value="2"}>
<{input type="hidden" name="business_id" value=$bid}>
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
    <tr><th><em class="red">*</em><{t}>用户名：<{/t}></th><td><{input type="text" name="pam_account[login_name]"  onchange="nameCheck(this)" size="20" vtype="required&&email" placeholder=$__b2c="此处请填写邮箱"|t:'b2c'}><span></span></td></tr>
    <tr><th><em class="red">*</em><{t}>密码：<{/t}></th><td><{input type="password" name="pam_account[login_password]" size="20" vtype="required"}></td></tr>
    <tr><th><em class="red">*</em><{t}>确认密码：<{/t}></th><td><{input type="password" name="pam_account[psw_confirm]" size="20" vtype="required"}></td></tr>
    <tr><th><em class="red">*</em><{t}>会员等级<{/t}></th><td> <{input type='select' name='member_lv[member_group_id]' options=$mem.lv.options required=true value=$mem.lv.value }>  </td>
	</tr>
</table>
</div>
<div class="table-action"><{button type="submit" label=$___b2c="保存"|t:'b2c' }></div>
</form>
<div>
<{include file='admin/business/page_sub_list.html'}>
</div>
<script>
function nameCheck(input){
	new Request({
		url:'<{link app=b2c ctl=admin_member act=namecheck_email}>',
		method:'post',
		data:input.name+'='+encodeURIComponent(input.value=input.value.trim()),
		onSuccess: function(rs) {
			rs = JSON.decode(rs);
			if(rs.error) {
				input.getNext().innerHTML = '<span class="error caution notice-inline">' +rs.error + '</span>';
			}
			else if(rs.success) {
				input.getNext().innerHTML = '<span class="success notice-inline">' +rs.success + '</span>';
			}
		}
	}).send();
}
</script>